<?php /* Smarty version 2.6.18, created on 2010-03-06 18:58:32
         compiled from editaddress.tpl */ ?>
<form name="mainForm" method="POST" id="mainForm">
<input type="hidden" name="user[address_id]" value="<?php echo $this->_tpl_vars['address'][0]['address_id']; ?>
">
<input type="hidden" name="user[org_address_id]" value="<?php echo $this->_tpl_vars['address'][0]['org_address_id']; ?>
">
<input type="hidden" name="user[staff_view]" value="<?php echo $this->_tpl_vars['staffView']; ?>
">
<input type="hidden" name="user[staff_id]" value="<?php echo $this->_tpl_vars['staffId']; ?>
">
<table class="popup" border="0" cellspacing=0 cellpadding=0>
	<tr><td><div class="pop">
		<div class="top_pop"><img src="/app/default/www/images/top_left_pop.jpg" /></div> 
		<div id="drag_bar"><h2 class="pop_h2">Edit Address</h2></div>
		<div class="content">
			<table border="0" width="100%">
				<tr>
					<td>Address Type:</td>
					<?php if ($this->_tpl_vars['address'][0]['address_type'] != ''): ?>
						<input type="hidden" name="user[address_type]" value="<?php echo $this->_tpl_vars['address'][0]['address_type']; ?>
">
						<td><?php echo $this->_tpl_vars['address'][0]['address_type']; ?>
</td>
					<?php else: ?>
					<td>
						<select name="user[address_type]">
							<option value="Shipping">Shipping</option>
							<option value="Billing">Billing</option>
							<option value="Crossdock">Crossdock</option>
							<option value="Warehouse">Warehouse</option>
							<option value="Others">Others</option>
						</select>
					</td>
					<?php endif; ?>
				</tr>
				<tr>
					<td>Address 1:</td>
					<td><input type="text" name="user[address1]" value="<?php echo $this->_tpl_vars['address'][0]['address1']; ?>
" style="width:350px"></td>
				</tr>
				<tr>
					<td>Address 2:</td>
					<td><input type="text" name="user[address2]" value="<?php echo $this->_tpl_vars['address'][0]['address2']; ?>
" style="width:350px"></td>
				</tr>
				<tr>
					<td>City:</td>
					<td><input type="text" name="user[city]" value="<?php echo $this->_tpl_vars['address'][0]['city']; ?>
" style="width:350px"></td>
				</tr>
				<tr>
					<td>Province:</td>
					<td><input type="text" name="user[province]" value="<?php echo $this->_tpl_vars['address'][0]['province']; ?>
" style="width:350px"></td>
				</tr>
				<tr>
					<td>Country:</td>
					<td><select name="user[country_code]">
						<?php $_from = $this->_tpl_vars['countries']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['country']):
?>
							<option value=<?php echo $this->_tpl_vars['country']['country_code']; ?>
 <?php if ($this->_tpl_vars['address'][0]['country_code'] == $this->_tpl_vars['country']['country_code']): ?> SELECTED <?php endif; ?>><?php echo $this->_tpl_vars['country']['country']; ?>
</option>
						<?php endforeach; endif; unset($_from); ?>
					</select></td>
				</tr>
				<tr>
					<td>Zip:</td>
					<td><input type="text" name="user[zip]" value="<?php echo $this->_tpl_vars['address'][0]['zip']; ?>
" ></td>
				</tr>
				<tr>
					<td>Default Address:</td>
					<td><input type="checkbox" name="user[primary_address]" <?php if ($this->_tpl_vars['address'][0]['primary_address'] == 'Yes'): ?> CHECKED <?php endif; ?> /></td>
				</tr>
				<tr><td height="10px"></td></tr>
				<tr>
					<td colspan="5" align="center">
						<input type="button" value="Save" onclick="saveAddress();">&nbsp;
						<input type="button" value="Close" onclick="popup('editAddress');">
					</td>
				</tr>
			</table>
		</div>
		<div class="btm_pop"><img src="/app/default/www/images/btm_left_pop.jpg"  alt="" />
	</div></td></tr>
</table>
</form>
<script language="javascript">
<?php echo '
	function saveAddress() {
		popup(\'editAddress\');
		doajaxAction("/account/saveAddress/",1,\'main_content\',document.getElementById(\'mainForm\'));
	}

'; ?>

</script>